#include "../pch.h"
#include "core/REFNameTable.h"

namespace BFX
{

REFXMLNotation::REFXMLNotation(const UniString& strName, const UniString& strPublicId, const UniString& strSystemId, REFXMLDocument* pDoc)
	: REFXMLNode(pDoc)
{
	m_strName = pDoc->GetNameTable()->Add(strName);
	m_strPublicId = strPublicId;
	m_strSystemId = strSystemId;
}
REFXMLNotation::~REFXMLNotation()
{
}

// Gets the name of the node.
UniString REFXMLNotation::GetName() const
{
	return m_strName;
}

// Gets the name of the current node without the namespace prefix.
UniString REFXMLNotation::GetLocalName() const
{
	return m_strName;
}

// Gets the type of the current node.
XMLNodeType REFXMLNotation::GetNodeType() const
{
	return XMLNodeType_Notation;
}

// Without override these two functions, we can't guarantee that WriteTo()/WriteContent() functions will never be called
UniString REFXMLNotation::GetOuterXml() const
{
	return UniString();
}

UniString REFXMLNotation::GetInnerXml() const
{
	return UniString();
}
void REFXMLNotation::SetInnerXml(const UniString& str)
{
	BFX_ENSURE1(false, "Cannot set the 'InnerXml' for the current node because it is either read-only or cannot have children.");
}

// Saves the node to the specified XmlWriter.
void REFXMLNotation::WriteTo(REFXMLWriter* w) const
{
	// NOTE: intentionally do nothing
}

// Saves all the children of the node to the specified XmlWriter.
void REFXMLNotation::WriteContentTo(REFXMLWriter* w) const
{
	// NOTE: intentionally do nothing
}

// Gets the value of the public identifier on the notation declaration.
UniString REFXMLNotation::GetPublicId() const
{
	return m_strPublicId;
}

// Gets the value of the system identifier on the notation declaration.
UniString REFXMLNotation::GetSystemId() const
{
	return m_strSystemId;
}

}	//	namespace BFX
